/**
 * Created by dev-001 on 2017/2/28.
 * 题库
 */
import mongoose from 'mongoose';
const Schema = mongoose.Schema;
const ObjectId = Schema.Types.ObjectId;
const LibrarySchema = new Schema({
    name: String,
    question: String, //题干
    answer: String, //答案
    questionType: String,  //类型
    questionFrom: String, //来源
    used: Number, //引用次数
    createdAt: Date,
    updatedAt: Date
});

LibrarySchema.pre('save', function (next) {
    this.createdAt = new Date();
    next();
});

export default mongoose.model('Library', LibrarySchema);